package mysql_table_structure;

import mysql_table_structure.utils.DBDataToWord;
import mysql_table_structure.utils.TableUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Hello world!
 *
 */
public class App 
{

    public static String DB_URL = "172.16.2.180";
    public static String DATABASE = "sunmnet_leader_cockpit_xt";
    public static String DB_USER = "root";
    public static String DB_PWD = "root";

    public static void main(String[] args) throws Exception {

        Map<String,Object> params = TableUtils.getTablesList();
        XWPFDocument xdoc = new XWPFDocument();
        DBDataToWord xsg_data = new DBDataToWord();
        for(Map.Entry<String,Object> entry : params.entrySet()){
            String tableName = entry.getKey();
            String tableName_CN = String.valueOf(entry.getValue());
            xsg_data.createTable(xdoc,tableName,tableName_CN);
        }
        xsg_data.saveDocument(xdoc, "f:/" + "database" + ".docx");


    }



}
